package com.qqtech.qquan.user.model;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.enums.SexEnum;
import com.qqtech.core.common.util.StringUtil;
import com.qqtech.qquan.user.enums.UserConst;

@SuppressWarnings("serial")
public class UserFriendVo extends UserFriend{
	
	/**好友id,因为userId1或者userId2表达的意思不够直观,在前端处理好友列表时用friendId会更直观
	 * friendId,friendName,friendLogo 意义类同
	 **/
	private java.lang.Integer friendId;
	/**好友名称**/
	private java.lang.String friendName;
	/**好友头象**/
	private java.lang.String friendLogo;
	private java.lang.Integer sex;
	/** 兴趣爱好，如足球,篮球,羽毛球 中间以逗号隔开 */
	private java.lang.String interests;
	
	/**是否邻居**/
	private boolean isNeighbor = false;
	/**共同加入圈子数量**/
	private java.lang.Integer ourCircleCount;
	
	/**是否圈子成员**/
	private boolean isCircleMember;
	/**
	 * 是否我自己,用于区分好友列表中的"我"
	 */
	private boolean isMe;
	
	/** 备注-全拼*/
	private java.lang.String chnSpell;
	
	private java.lang.String remark;
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}
	public java.lang.Integer getFriendId() {
		return friendId;
	}
	public void setFriendId(java.lang.Integer friendId) {
		this.friendId = friendId;
	}
	public java.lang.String getFriendName() {
		if(StringUtil.isBlank(friendName)){
			return "新手";
		}
		return friendName;
	}
	public void setFriendName(java.lang.String friendName) {
		this.friendName = friendName;
	}
	public java.lang.String getFriendLogo() {
		return friendLogo;
	}
	public void setFriendLogo(java.lang.String friendLogo) {
		this.friendLogo = friendLogo;
	}
	
	/**
	 * 好友头像全URL
	 * example: http://192.168.1.xxx:8080/circle/1.png
	 * @return
	 */
	public java.lang.String getFullFriendLogo() {
		if(StringUtil.isBlank(this.getFriendLogo())){
			return "source://image/common/userLogin.png";
		}else if(this.getFriendLogo().indexOf("source://")>-1){
			return this.getFriendLogo();
		} else{
			return super.getImgHandleDomain()+""+this.getFriendLogo()+""+UserConst.IMG_POSTFIX;
		}
	}

	public boolean isMe() {
		return isMe;
	}
	public void setMe(boolean isMe) {
		this.isMe = isMe;
	}
	public java.lang.Integer getSex() {
		return sex;
	}
	public java.lang.String getSexColor() {
		if(this.getSex()==null){
			return "3EC8B1FF";//男
		}
		if(this.getSex() == SexEnum.FEMALE.getCode()){
			return "F883B8FF";//女
		}else{
			return "3EC8B1FF";//男
		}
	}
	public java.lang.String getSexIcon() {
		if(this.getSex()==null){
			return "♂";//男
		}
		if(this.getSex() == SexEnum.FEMALE.getCode()){
			return "♀";//女
		}else{
			return "♂";//男
		}
	}
	public void setSex(java.lang.Integer sex) {
		this.sex = sex;
	}
	public java.lang.String getInterests() {
		return interests;
	}
	
	public String[] getInterestList() {
		if(StringUtil.isBlank(interests)){
			return new String[0];
		}else{
			return interests.split(",");
		}
	}
	public void setInterests(java.lang.String interests) {
		this.interests = interests;
	}
	public boolean isCircleMember() {
		return isCircleMember;
	}
	public void setCircleMember(boolean isCircleMember) {
		this.isCircleMember = isCircleMember;
	}
	public boolean isNeighbor() {
		return isNeighbor;
	}
	public void setNeighbor(boolean isNeighbor) {
		this.isNeighbor = isNeighbor;
	}
	public java.lang.Integer getOurCircleCount() {
		return ourCircleCount;
	}
	public java.lang.String getOurCircleDesc() {
		if(this.getOurCircleCount()==null){
			return "";
		}
		if(this.getOurCircleCount() > 0){
			return "同在"+this.ourCircleCount+"个圈子";
		}else{
			return "";
		}
	}
	public void setOurCircleCount(java.lang.Integer ourCircleCount) {
		this.ourCircleCount = ourCircleCount;
	}
	public java.lang.String getFirstChar() {
		if (StringUtil.isNotBlank(this.getChnSpell())) {
			return this.getChnSpell().substring(0, 1);
		} else {
			return "#";
		}
	}
	public java.lang.String getChnSpell() {
		return chnSpell;
	}
	public void setChnSpell(java.lang.String chnSpell) {
		this.chnSpell = chnSpell;
	}
	public java.lang.String getRemark() {
		return remark;
	}
	public void setRemark(java.lang.String remark) {
		this.remark = remark;
	}
}